<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Livewire 
Description: A two-column, fixed-width design with dark color scheme.
Version    : 1.0
Released   : 20130820

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hall Of Fame</title>
  <meta content="" name="description">
  <meta content="Porfirio" name="author">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta name="keywords" content="" />
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900" rel="stylesheet" />
<link href="css/default.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/fonts.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/main.css" rel="stylesheet" type="text/css" media="all" />
<link rel="icon" type="image/png" href="images/icons/ic_launcher-web.png" />
<!--[if IE 6]>
<link href="default_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-48641254-1', 'altervista.org');
  ga('send', 'pageview');

</script>
</head>
<body id="header-wrapper-halloffame" class="portfolio-wrapper portfolio">


<div> 
<h2 class="title" style="margin: auto; position: relative;text-align: center; padding-top: 50px; padding-bottom: 30px;">I misteri migliori</h1>
<nav></nav><br>
<div class="box">
<table style="text-align: center; margin: auto; position: relative; width: 80%;"
 border="0" cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <td><h2>Posizione</h2></td>
      <td><h2>Giocatore</h2></td>
      <td><h2>Punteggio</h2></td>     
      <td><h2>Tipo del Mistero</h2></td>      
      <td><h2>Data</h2></td>
    </tr>

<?php 
 $nomecorrente=$_GET['nome'];
 $punteggiocorrente=$_GET['punteggio'];
 $trovato=0;
 $File = "halloffame.csv"; 
 $lines = file($File);
 sort($lines);
 for ($i=count($lines);$i>=0;$i--){
    if ($lines[$i]!=""){	
	    echo "<tr>";	
		list($punteggio, $nome, $grandezza, $livello, $soggetto, $amici, $robustezza, $bellezza, $leggerezza, $teologia, $data) =    split(",", $lines[$i], 11);
		//if (($nome==$nomecorrente)&&((int)$punteggio==(int)$punteggiocorrente)&&($trovato==0))
		//	echo "<b> TROVATO!"+(count($lines)-$i);
		echo "<td class='byline'>";echo count($lines)-$i; echo ". </td>";
		echo "<td class='byline'>";echo $nome; echo "</td>";
		if (strpos($punteggio, '.')>0)
			$punteggio=substr($punteggio, 0,strpos($punteggio, '.'));
		echo "<td class='byline'>";echo $punteggio; echo "</td>";
		echo "<td class='byline'>";echo $soggetto;echo "</td>";
		echo "<td class='byline'>";echo $data;echo "</td>";	
		echo "</td>";
		//if (($nome==$nomecorrente)&&((int)$punteggio==(int)$punteggiocorrente)&&($trovato==0)){
		//	echo "</b>";		
		//	$trovato=1;
		//}
		echo "</tr>";
	}
 	}
 ?>
    </tr>
  </tbody>
</table>
</div>
<div style="width= 100%; position: relative; margin: auto;" >
	<?php 
	echo "<a class='button' href='index.html?nome=";
	echo $_GET['nome'];
	echo "'  >Un'altra partita</a>"; 
	?>	
	</div>
</div>
</body>
</html>
